﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TinhKeThua_2
{
    public class ptGiaoThong
    {
        protected int taiTrong;
        protected string loaiDongCo;
        protected string bienSo;

        public ptGiaoThong()
        {
            taiTrong = 100;
            loaiDongCo = "Hop So";
            bienSo = "";

        }
        public void diChuyen()
    {
        Console.WriteLine("Dang di chuyen tu diem A toi diem B");
    }
        public void thongTinXe()
        {
            Console.WriteLine("tai trong cua xe la :{0}",taiTrong);
            Console.WriteLine("Loai dong co xe dang chay la dang : {0}",loaiDongCo);
            Console.WriteLine("Xe mang bien so : {0}",bienSo);

        }
    }
   public class xeMay : ptGiaoThong
    {
       public xeMay()
       {
           taiTrong = 250;
           loaiDongCo = "Hop so,2 thi";
           bienSo = "88K4-7383";
       }
      public new virtual void diChuyen()
       {
           base.diChuyen();
           Console.WriteLine("Bang phuong tien xe may");
       }

    }
   public class xeTai : ptGiaoThong
   {
       public xeTai()
       {
           taiTrong = 5000;
           loaiDongCo = "Diesel";
           bienSo="";

       }
       public new void diChuyen()
       {
           base.diChuyen();
           Console.WriteLine("Bang phuong tien xe tai");
       }

   }
   public class xeDap:ptGiaoThong
   {
       public xeDap()
       {
           taiTrong = 30;
           loaiDongCo = "khong co";
           bienSo = "88k4-9999";
       }
       new virtual void diChuyen()
       {
           base.diChuyen();
           Console.WriteLine("Bang phuong tien xe dap");
       }
   }
    class Program
    {
        static void Main(string[] args)
        {
            
            xeMay xm = new xeMay();
            Console.WriteLine("Doi tuong xe may trong chuong trinh");
            xm.thongTinXe();
            xm.diChuyen();
            Console.WriteLine("=====================================");
            xeDap xd = new xeDap();
            Console.WriteLine("Doi tuong xe dap trong chuong trinh");
            xd.thongTinXe();
            xd.diChuyen();
            Console.WriteLine("======================================");
            xeTai xt = new xeTai();
            xt.thongTinXe();
            xt.diChuyen();
            Console.WriteLine("======================================");
            
        }
    }
}
